package com.cleaningcloud.erp.domain;

import com.cleaningcloud.common.core.annotation.Excel;
import com.cleaningcloud.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购单对象 erp_procure
 *
 * @author cleaningcloud
 * @date 2024-09-26
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ErpProcure extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 采购ID
     */
    private Long procureId;

    /**
     * 采购单号
     */
    @Excel(name = "采购单号", sort = 1)
    private String procureNo;

    /**
     * 供应商ID
     */
    private Long supplierId;

    // 供应商名称
    private String supplierName;

    /**
     * 采购时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采购日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 5)
    private Date procureTime;

    /**
     * 采购人ID
     */
    private Long procurePersonId;


    /**
     * 物流费用
     */
    @Excel(name = "物流费用", sort = 9)
    private BigDecimal logisticsCost;

    /**
     * 物流费用分摊方式(1按重量分摊2按体积分摊)
     */
    private Long logisticsMethod;

    /**
     * 其他费用
     */
    private BigDecimal otherCost;

    /**
     * 其他费用分摊方式(1按重量分摊2按体积分摊)
     */
    private Long otherMethod;

    /**
     * 应付金额
     */
    @Excel(name = "应付金额", sort = 10)
    private BigDecimal payAmount;

    /**
     * 物流状态(0未发货1已发货2已收货)
     */
    @Excel(name = "物流状态", sort = 4, readConverterExp = "0=未发货,1=已发货,2=已收货")
    private String logisticsStauts;

    /**
     * 附件
     */
    private String attr;

    /**
     * 创建人ID
     */
    private Long createId;

    /**
     * 创建人名称
     */
    @Excel(name = "创建人", sort = 13)
    private String createName;

    /**
     * 备注是否关闭
     */
    private String flag;

    /**
     * 审批人ID
     */
    private Long approveId;

    /**
     * 审批人名称
     */
    @Excel(name = "审批人", sort = 11)
    private String approveName;

    /**
     * 审批时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 12)
    private Date approveTime;

    /**
     * 驳回时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date rejectTime;

    /**
     * 驳回原因
     */
    private String rejectReason;

    /**
     * 采购状态(0草稿1待审批2已通过3被驳回4已完成)
     */
    @Excel(name = "采购状态", sort = 3, readConverterExp = "0=草稿,1=待审批,2=已通过,3=被驳回,4=已完成")
    private Integer procureStatus;
}
